<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<title>Summary of Ranks</title>
	</head>
	<body>	
		<%@ include file="HeaderAdmin.jsp" %>
		<center>
			<table border='0' cellpadding='5' cellspacing='5'>
				<tr align='left'>
					<td colspan='5'><b>List of Ranks:</b></td>
					<td>
						<a href="RankDetail">Add Rank</a>
					</td>
				</tr>
				<tr align='left'>
					<td>Rank ID</td>
					<td>Rank Name</td>
					<td>Total Days</td>
					<td>Total Employees</td>
					<td>Edit</td>
					<td>Delete</td>
				</tr>
					<c:forEach var="rankListBean" items="${requestScope.RankList}">
					<tr align='left'>
						<td>${rankListBean.rank_id}</td>
						<td>${rankListBean.rank_name}</td>
						<td>${rankListBean.total_days}</td>
						<td>${rankListBean.totalEmployees}</td>
						<td><a href="RankDetail?EditRankId=${rankListBean.rank_id}">Edit</a></td>
						<c:if test="${rankListBean.totalEmployees==0}">
							<td><a href="RankDelete?RankId=${rankListBean.rank_id}">Delete</a></td>
						</c:if>
						<c:if test="${rankListBean.totalEmployees>=1}">
							<td>Cannot Delete</td>
						</c:if>	
					</tr>
				</c:forEach>
			</table>		
		</center>
	</body>
</html>